<?php

/**
 * @author elson
 */
interface IEMongoDocument
{
    const SCENARIO_UPDATE = 'update';
    const SCENARIO_INSERT = 'insert';
    
    /**
     * get a model object
     * @param string $id
     * @return boolean|Object
     */
    public function getById($id, $criteria=null);
    
    /**
     * Delete the document by id string
     * @param string $id
     * @return boolean
     */
    public function deleteById($id, $criteria=null);
    
    /**
     * get the id of the owner
     * @return string|MongoId
     */
    public function getId($returnMongo=false);
    
    /**
     * get the runtime id, the same object is the same, but for the same record, but not the same object is different.
     * @return string
     */
    public function getRuntimeId();
    
    /**
     * check the owner of the given id does exist or not
     * @param string $id
     * @return boolean
     */
    public function checkExistById($id);
    
    /**
     * get the default scenario array
     * @return array
     */
    public function getDefaultScenarios();
    
    /**
     * check the given scenario is default or not
     * @param string $scenario default is current scenario of this model
     * @return boolean
     */
    public function getIsDefaultScenario($scenario=null);
}